package com.mongo.controller;

import com.mongo.Impl.StudentRepository;
import com.mongo.bean.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Optional;

/**
 * @ClassName StuController
 * @Description TODO
 * @Author louby0923
 * @Date 2024/2/2 16:34
 * @Version 1.0
 */
public class StuController {
    @Autowired
    private StudentRepository studentRepository;
    @RequestMapping("/getStuByName/{name}")
    public Optional<Student> getSchool1() {
        Optional<Student> stu = studentRepository.findById(1L);
        return stu;
    }
}
